--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--

---@type BP_Enemy_C
local M = Class("Core/CBP_Base")
local Screen = require "Screen"
local Const = require "Const"

function M:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser)
	self.Super.ReceiveAnyDamage(self, Damage, DamageType, InstigatedBy, DamageCauser)

  -- Screen.Print('ReceiveAnyDamage: BP_Enemy')

  -- self.Mesh:SetAllBodiesBelowSimulatePhysics(self.BoneName, true, true)
  -- 蓝图里定义的结构体名为Struct1
  -- UE4.FStruct1()
  -- local ZombieAnimState = LoadObject('/Game/Assets/ZombieAI/ZombieAnimState.ZombieAnimState')
  -- Enemy.CurrentAnimState = ZombieAnimState.Died
  local GameMode = UE.UGameplayStatics.GetGameMode(self)
  if GameMode then
    local BPI_IF= UE.UClass.Load(Const.BPI_IF)
    BPI_IF.NotifyEnemyDied(GameMode)
  end
end

function M:ChangeToRagdoll()
	self.Mesh:SetCollisionProfileName("Ragdoll")
	self.Mesh:SetSimulatePhysics(true)
end

return M
